var builder = WebApplication.CreateBuilder(args);

builder.Services.AddHttpClient("service-b")
    .ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler()
    {
        // ClientCertificateOptions = ClientCertificateOption.Manual,
        ServerCertificateCustomValidationCallback =
            (httpRequestMessage, cert, cetChain, policyErrors) => true
    });

var app = builder.Build();

app.MapGet("/", () => "Hello CleanSolution ServiceA!");


app.MapGet("/call-serviceb", async (IHttpClientFactory factory) =>
{
    var httpClient = factory.CreateClient("service-b");
    var res = await httpClient.GetStringAsync("https://cleansolution-serviceb/");

    return res;
});

app.Run();